Fencing data transfers in a parallel active messaging interface of a parallel computer

ABSTRACT

Fencing data transfers in a parallel active messaging interface (‘PAMI’) of a parallel computer, the PAMI including data communications endpoints, each endpoint including a specification of data communications parameters for a thread of execution on a compute node, including specifications of a client, a context, and a task; the compute nodes coupled for data communications through the PAMI and through data communications resources including at least one segment of shared random access memory; including initiating execution through the PAMI of an ordered sequence of active SEND instructions for SEND data transfers between two endpoints, effecting deterministic SEND data transfers through a segment of shared memory; and executing through the PAMI, with no FENCE accounting for SEND data transfers, an active FENCE instruction, the FENCE instruction completing execution only after completion of all SEND instructions initiated prior to execution of the FENCE instruction for SEND data transfers between the two endpoints.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation application of and claims priorityfrom U.S. patent application Ser. No. 12/940,259, filed on Nov. 5, 2010.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

This invention was made with Government support under Contract No.B554331 awarded by the Department of Energy. The Government has certainrights in this invention.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The field of the invention is data processing, or, more specifically,methods, apparatus, and products for fencing data transfers in aparallel active messaging interface (‘PAMI’) of a parallel computer.

2. Description of Related Art

The development of the EDVAC computer system of 1948 is often cited asthe beginning of the computer era. Since that time, computer systemshave evolved into extremely complicated devices. Today's computers aremuch more sophisticated than early systems such as the EDVAC. Computersystems typically include a combination of hardware and softwarecomponents, application programs, operating systems, processors, buses,memory, input/output devices, and so on. As advances in semiconductorprocessing and computer architecture push the performance of thecomputer higher and higher, more sophisticated computer software hasevolved to take advantage of the higher performance of the hardware,resulting in computer systems today that are much more powerful thanjust a few years ago.

Parallel computing is an area of computer technology that hasexperienced advances. Parallel computing is the simultaneous executionof the same application (split up and specially adapted) on multipleprocessors in order to obtain results faster. Parallel computing isbased on the fact that the process of solving a problem usually can bedivided into smaller jobs, which may be carried out simultaneously withsome coordination.

Parallel computers execute parallel algorithms. A parallel algorithm canbe split up to be executed a piece at a time on many differentprocessing devices, and then put back together again at the end to get adata processing result. Some algorithms are easy to divide up intopieces. Splitting up the job of checking all of the numbers from one toa hundred thousand to see which are primes could be done, for example,by assigning a subset of the numbers to each available processor, andthen putting the list of positive results back together. In thisspecification, the multiple processing devices that execute theindividual pieces of a parallel program are referred to as ‘computenodes.’ A parallel computer is composed of compute nodes and otherprocessing nodes as well, including, for example, input/output (‘I/O’)nodes, and service nodes.

Parallel algorithms are valuable because it is faster to perform somekinds of large computing jobs via a parallel algorithm than it is via aserial (non-parallel) algorithm, because of the way modern processorswork. It is far more difficult to construct a computer with a singlefast processor than one with many slow processors with the samethroughput. There are also certain theoretical limits to the potentialspeed of serial processors. On the other hand, every parallel algorithmhas a serial part and so parallel algorithms have a saturation point.After that point adding more processors does not yield any morethroughput but only increases the overhead and cost.

Parallel algorithms are designed also to optimize one more resource thedata communications requirements among the nodes of a parallel computer.There are two ways parallel processors communicate, shared memory ormessage passing. Shared memory processing needs additional locking forthe data and imposes the overhead of additional processor and bus cyclesand also serializes some portion of the algorithm.

Message passing processing uses high-speed data communications networksand message buffers, but this communication adds transfer overhead onthe data communications networks as well as additional memory need formessage buffers and latency in the data communications among nodes.Designs of parallel computers use specially designed data communicationslinks so that the communication overhead will be small but it is theparallel algorithm that decides the volume of the traffic.

Many data communications network architectures are used for messagepassing among nodes in parallel computers. Compute nodes may beorganized in a network as a ‘torus’ or ‘mesh,’ for example. Also,compute nodes may be organized in a network as a tree. A torus networkconnects the nodes in a three-dimensional mesh with wrap around links.Every node is connected to its six neighbors through this torus network,and each node is addressed by its x,y,z coordinate in the mesh. In atree network, the nodes typically are connected into a binary tree: eachnode has a parent and two children (although some nodes may only havezero children or one child, depending on the hardware configuration). Incomputers that use a torus and a tree network, the two networkstypically are implemented independently of one another, with separaterouting circuits, separate physical links, and separate message buffers.

A torus network lends itself to point to point operations, but a treenetwork typically is inefficient in point to point communication. A treenetwork, however, does provide high bandwidth and low latency forcertain collective operations, message passing operations where allcompute nodes participate simultaneously, such as, for example, anallgather.

One-sided message passing is a way to transmit information withoutactive participation from a communications target, and FENCEinstructions and protocols advise applications of completion ofparticular sequences of data communications instructions. TraditionalFENCE protocols, however, are artifacts of application-level messagingmodules, two-sided, inefficient, burdensome, difficult to implement.Existing FENCE protocols, for example, employ FENCE accounting withlarge counter arrays to guarantee the validity of FENCE operations.Readers will recognize that much of the usefulness of paralleloperations, such as FENCE operations, is processing control on massivelyparallel machines, ‘supercomputers,’ with possibly thousands of computenodes, millions of data communications endpoints each of which sends toall others, and therefore trillions of messages, so that suchtraditional FENCE accounting would require maintenance of huge counterarrays.

Parallel compute nodes, even in supercomputers, typically have limitedon-board memory, so that large arrays of completion counters simplycannot scale. IBM's next-generation Blue Gene™ supercomputer, forexample, supports on the order of a million communications endpoints,although each hardware process will have assigned to it only 250 MB ofRAM, much too much of which would be occupied by any attempt attraditional FENCE accounting with counter arrays. Another inefficiencyin traditional FENCE operations is that acknowledgement packets, evenfor one-sided operations, lead very quickly to excessive networkcongestion and poor latency even for one-sided operations, easily to beseen in a supercomputer setting with a few trillion messages in flight.

SUMMARY OF THE INVENTION

Methods, apparatus, and computer program products for fencing datatransfers in a parallel active messaging interface (‘PAMI’) of aparallel computer, the parallel computer comprising a plurality ofcompute nodes that execute a parallel application; the PAMI comprisingdata communications endpoints, each endpoint comprising a specificationof data communications parameters for a thread of execution on a computenode, including specifications of a client, a context, and a task; thecompute nodes coupled for data communications through the PAMI andthrough data communications resources including at least one segment ofshared random access memory through which data communications aredelivered to target endpoints in the same order in which thecommunications are transmitted from origin endpoints; includinginitiating execution through the PAMI of an ordered sequence of activeSEND instructions for SEND data transfers between two endpoints, anorigin endpoint and a target endpoint, each SEND instruction effecting adeterministic SEND data transfer through a segment of shared memory inwhich the SEND data transfers are effected according to the orderedsequence of the SEND instructions; and executing through the PAMI, withno FENCE accounting for SEND data transfers, an active FENCEinstruction, the FENCE instruction completing execution only aftercompletion of all SEND instructions initiated prior to execution of theFENCE instruction for SEND data transfers between the two endpoints.

The foregoing and other objects, features and advantages of theinvention will be apparent from the following more particulardescriptions of example embodiments of the invention as illustrated inthe accompanying drawings wherein like reference numbers generallyrepresent like parts of example embodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 sets forth a block and network diagram of an example parallelcomputer that fences data transfers in a parallel active messaginginterface (‘PAMI’) according to embodiments of the present invention.

FIG. 2 sets forth a block diagram of an example compute node useful inparallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 3A illustrates an example Point To Point Adapter useful in parallelcomputers that fence data transfers in a PAMI according to embodimentsof the present invention.

FIG. 3B illustrates an example Collective Operations Adapter useful inparallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 4 illustrates an example data communications network optimized forpoint to point operations and useful in parallel computers that fencedata transfers in a PAMI according to embodiments of the presentinvention.

FIG. 5 illustrates an example data communications network optimized forcollective operations by organizing compute nodes in a tree and usefulin parallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 6 sets forth a block diagram of an example protocol stack useful inparallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 7 sets forth a functional block diagram of an example PAMI usefulin parallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 8 sets forth a functional block diagram of example datacommunications resources useful in parallel computers that fence datatransfers in a PAMI according to embodiments of the present invention.

FIG. 9 sets forth a functional block diagram of an example PAMI usefulin parallel computers that fence data transfers in a PAMI according toembodiments of the present invention.

FIG. 10 sets forth a functional block diagram of example endpointsuseful in parallel computers that fence data transfers in a PAMIaccording to embodiments of the present invention.

FIG. 11 sets forth a flow chart illustrating an example method offencing data transfers in a PAMI of a parallel computer according toembodiments of the present invention.

FIG. 12 sets forth a flow chart illustrating an example of a sharedmemory rendezvous method of fencing data transfers in a PAMI of aparallel computer according to embodiments of the present invention.

FIG. 13 sets forth a calling sequence diagram illustrating an example ofa shared memory rendezvous method of fencing data transfers in a PAMI ofa parallel computer according to embodiments of the present invention.

FIG. 14 sets forth a flow chart illustrating an example of a sharedmemory eager method of fencing data transfers in a PAMI of a parallelcomputer according to embodiments of the present invention.

FIG. 15 sets forth a calling sequence diagram illustrating an example ofa shared memory eager method of fencing data transfers in a PAMI of aparallel computer according to embodiments of the present invention.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

Example methods, computers, and computer program products for fencingdata transfers in a parallel active messaging interface (‘PAMI’)according to embodiments of the present invention are described withreference to the accompanying drawings, beginning with FIG. 1. FIG. 1sets forth a block and network diagram of an example parallel computer(100) that fences data transfers in a parallel active messaginginterface (‘PAMI’) according to embodiments of the present invention.The parallel computer (100) in the example of FIG. 1 is coupled tonon-volatile memory for the computer in the form of data storage device(118), an output device for the computer in the form of printer (120),and an input/output device for the computer in the form of computerterminal (122). The parallel computer (100) in the example of FIG. 1includes a plurality of compute nodes (102).

The parallel computer (100) in the example of FIG. 1 includes aplurality of compute nodes (102). The compute nodes (102) are coupledfor data communications by several independent data communicationsnetworks including a high speed Ethernet network (174), a Joint TestAction Group (‘JTAG’) network (104), a tree network (106) which isoptimized for collective operations, and a torus network (108) which isoptimized point to point operations. Tree network (106) is a datacommunications network that includes data communications links connectedto the compute nodes so as to organize the compute nodes as a tree. Eachdata communications network is implemented with data communicationslinks among the compute nodes (102). The data communications linksprovide data communications for parallel operations among the computenodes of the parallel computer.

In addition, the compute nodes (102) of parallel computer are organizedinto at least one operational group (132) of compute nodes forcollective parallel operations on parallel computer (100). Anoperational group of compute nodes is the set of compute nodes uponwhich a collective parallel operation executes. Collective operationsare implemented with data communications among the compute nodes of anoperational group. Collective operations are those functions thatinvolve all the compute nodes of an operational group. A collectiveoperation is an operation, a message-passing computer programinstruction that is executed simultaneously, that is, at approximatelythe same time, by all the compute nodes in an operational group ofcompute nodes. Such an operational group may include all the computenodes in a parallel computer (100) or a subset all the compute nodes.Collective operations are often built around point to point operations.A collective operation requires that all processes on all compute nodeswithin an operational group call the same collective operation withmatching arguments. A ‘broadcast’ is an example of a collectiveoperations for moving data among compute nodes of an operational group.A ‘reduce’ operation is an example of a collective operation thatexecutes arithmetic or logical functions on data distributed among thecompute nodes of an operational group. An operational group may beimplemented as, for example, an MPI ‘communicator.’

‘MPI’ refers to ‘Message Passing Interface,’ a prior art applicationsmessaging module or parallel communications library, anapplication-level messaging module of computer program instructions fordata communications on parallel computers. Such an application messagingmodule is disposed in an application messaging layer in a datacommunications protocol stack. Examples of prior-art parallelcommunications libraries that may be improved for use with parallelcomputers that fence data transfers in a PAMI according to embodimentsof the present invention include IBM's MPI library, the ‘ParallelVirtual Machine’ (‘PVM’) library, MPICH, OpenMPI, and LAM/MPI. MPI ispromulgated by the MPI Forum, an open group with representatives frommany organizations that define and maintain the MPI standard. MPI at thetime of this writing is a de facto standard for communication amongcompute nodes running a parallel program on a distributed memoryparallel computer. This specification sometimes uses MPI terminology forease of explanation, although the use of MPI as such is not arequirement or limitation of the present invention.

Most collective operations are variations or combinations of four basicoperations: broadcast, gather, scatter, and reduce. In a broadcastoperation, all processes specify the same root process, whose buffercontents will be sent. Processes other than the root specify receivebuffers. After the operation, all buffers contain the message from theroot process.

A scatter operation, like the broadcast operation, is also a one-to-manycollective operation. All processes specify the same receive count. Thesend arguments are only significant to the root process, whose bufferactually contains sendcount*N elements of a given datatype, where N isthe number of processes in the given group of compute nodes. The sendbuffer will be divided equally and dispersed to all processes (includingitself). Each compute node is assigned a sequential identifier termed a‘rank.’ After the operation, the root has sent sendcount data elementsto each process in increasing rank order. Rank 0 receives the firstsendcount data elements from the send buffer. Rank 1 receives the secondsendcount data elements from the send buffer, and so on.

A gather operation is a many-to-one collective operation that is acomplete reverse of the description of the scatter operation. That is, agather is a many-to-one collective operation in which elements of adatatype are gathered from the ranked compute nodes into a receivebuffer in a root node.

A reduce operation is also a many-to-one collective operation thatincludes an arithmetic or logical function performed on two dataelements. All processes specify the same ‘count’ and the same arithmeticor logical function. After the reduction, all processes have sent countdata elements from computer node send buffers to the root process. In areduction operation, data elements from corresponding send bufferlocations are combined pair-wise by arithmetic or logical operations toyield a single corresponding element in the root process's receivebuffer. Application specific reduction operations can be defined atruntime. Parallel communications libraries may support predefinedoperations. MPI, for example, provides the following pre-definedreduction operations:

-   -   MPI_MAX maximum    -   MPI_MIN minimum    -   MPI_SUM sum    -   MPI_PROD product    -   MPI_LAND logical and    -   MPI_BAND bitwise and    -   MPI_LOR logical or    -   MPI_BOR bitwise or    -   MPI_LXOR logical exclusive or    -   MPI_BXOR bitwise exclusive or

In addition to compute nodes, the example parallel computer (100)includes input/output (‘I/O’) nodes (110, 114) coupled to compute nodes(102) through one of the data communications networks (174). The I/Onodes (110, 114) provide I/O services between compute nodes (102) andI/O devices (118, 120, 122). I/O nodes (110, 114) are connected for datacommunications I/O devices (118, 120, 122) through local area network(‘LAN’) (130). Computer (100) also includes a service node (116) coupledto the compute nodes through one of the networks (104). Service node(116) provides service common to pluralities of compute nodes, loadingprograms into the compute nodes, starting program execution on thecompute nodes, retrieving results of program operations on the computernodes, and so on. Service node (116) runs a service application (124)and communicates with users (128) through a service applicationinterface (126) that runs on computer terminal (122).

As the term is used here, a parallel active messaging interface or‘PAMI’ (218) is a system-level messaging layer in a protocol stack of aparallel computer that is composed of data communications endpoints eachof which is specified with data communications parameters for a threadof execution on a compute node of the parallel computer. The PAMI is a‘parallel’ interface in that many instances of the PAMI operate inparallel on the compute nodes of a parallel computer. The PAMI is an‘active messaging interface’ in that data communications messages in thePAMI are active messages, ‘active’ in the sense that such messagesimplement callback functions to advise of message dispatch andinstruction completion and so on, thereby reducing the quantity ofacknowledgment traffic and the like burdening the data communicationresources of the PAMI.

Each data communications endpoint of a PAMI is implemented as acombination of a client, a context, and a task. A ‘client’ as the termis used in PAMI operations is a collection of data communicationsresources dedicated to the exclusive use of an application-level dataprocessing entity, an application or an application messaging modulesuch as an MPI library. A ‘context’ as the term is used in PAMIoperations is composed of a subset of a client's collection of dataprocessing resources, context functions, and a work queue of datatransfer instructions to be performed by use of the subset through thecontext functions operated by an assigned thread of execution. In atleast some embodiments, the context's subset of a client's dataprocessing resources is dedicated to the exclusive use of the context. A‘task’ as the term is used in PAMI operations refers to a process ofexecution for the parallel application. That is, a task is typicallyimplemented as an identifier of a particular instance of an applicationexecuting on a compute node, a compute core on a compute node, or athread of execution on a multi-threading compute core on a compute node.

In the example of FIG. 1, the compute nodes (102) are coupled for datacommunications through a PAMI (218) and through data communicationsresources that include at least one segment (227) of shared randomaccess memory through which data communications are delivered to targetendpoints in the same order in which the communications are transmittedfrom origin endpoints. That is, the segment of shared memory is operatedso as to effect deterministic data communications among PAMI endpointson the compute nodes. Deterministic data communications are datacommunications that are delivered to target endpoints in the same orderin which the communications are transmitted from origin endpoints. Sucha segment of shared memory can be operated deterministically in a numberof ways. The segment can be subdivided into packet-sized bins, forexample, with one or more status flags or status bits indicating foreach bin whether the bin has been written to by a source endpoint sinceit was last read and whether the bin has been read by a target endpointsince it was last written. In this configuration, the segment of sharedmemory can have data written into it by a source endpoint, which thensets a ‘written’ bit, and read from it by a target endpoint, which thensets a ‘read’ bit. The writing function of the source endpoint typicallyis an advance function of a context of the source endpoint; the readingfunction of the target endpoint typically also is an advance function ofa context of the target endpoint.

The source endpoint, in transmitting data through such a segment ofshared memory, increments an address counter and steps through the bins,writing packetized data as it goes, wrapping back to the beginning ofthe segment when it reaches the end. If the source endpoint reaches apreviously written bin that has not yet been read by the targetendpoint, the source endpoint pauses writing until the bin has beenread. The target endpoint maintains an address counter and steps throughthe bins of the segment reading data from the bins. These data reads arememcopies, string moves, or the like, moves or copies of data from thesegment of shared memory into a receive buffer of the target endpoint.If the target endpoint arrives at a bin that has been read since it waswritten, the target endpoint ceases reading until more data has beenwritten by the source endpoint. Readers in view of this explanation willrecognize that such a segment of shared memory is operated in effectlike a kind of virtual network with virtual packet traffic, ‘virtual’ inthe sense that the segment of shared memory and the data packets operatevery like a network with data packets although the segment of sharedmemory is not actually a network and the data packets are not networkdata packets or network frames. At any rate, a segment of shared memoryso operated does function deterministically, delivering datacommunications to target endpoints in the same order in which thecommunications are transmitted from origin endpoints.

Also optionally in the example of FIG. 1, the compute nodes (102) can becoupled for data communications through the PAMI (218) and through adeterministic data communications network (108), in this example, thePoint To Point network (108). That is, the Point To Point network, whichis typically implemented as a torus or mesh, effects deterministic datacommunications among PAMI endpoints on the compute nodes. As mentionedabove, deterministic data communications are data communications thatare delivered to target endpoints in the same order in which thecommunications are transmitted from origin endpoints. Such a network canbe configured for deterministic operations in a number of ways. Thenetwork can be configured with routing information, tables orparameters, that specify and require communications between any twoparticular endpoints always to use exactly the same route through thenetwork; in this way, any transmissions between those two endpoints willalways be delivered to the target endpoint in exactly the same order inwhich the communications were injected into the network from the originendpoint. Alternatively, adapters, switches, and routers of the networkcan be configured to administer sequence numbers in packet headers orframe headers so that the network itself enforces sequencing regardlessof the route through the network for any particular packet or frame.Very likely other ways of implementing deterministic networks will occurto those of skill in the art, and all such ways are well within thescope of the present invention.

The parallel computer of FIG. 1 operates generally for fencing datatransfers in a PAMI by initiating execution through the PAMI (218) of anordered sequence (361) of active SEND instructions for SEND datatransfers between two endpoints, an origin endpoint and a targetendpoint. The origin endpoint and the target endpoint can be any twoendpoints on any of the compute nodes (102); the ordered sequence ofsend instructions result in data transfers between two specificendpoints, the origin endpoint and the target endpoint. The SENDinstructions are ‘active’ in the sense that the SEND instructionsimplement callback functions to advise of instruction dispatch andinstruction completion, thereby reducing the quantity of acknowledgmenttraffic required on the network. Each such SEND instruction effects adeterministic SEND data transfer, from the origin endpoint to the targetendpoint, through a segment (227) of shared memory in which the SENDdata transfers are effected according to the ordered sequence of theSEND instructions.

The parallel computer of FIG. 1 operates generally also for fencing datatransfers in the PAMI (218) by executing through the PAMI, with no FENCEaccounting for SEND data transfers, an active FENCE instruction (358).The FENCE instruction is an ‘active’ instruction in the sense that it isimplemented with the aid of callback functions. The FENCE instruction isdirected specifically to SEND instructions between two particularendpoints, the source endpoint and the target endpoint, and the FENCEinstruction completes execution only after completion of all SENDinstructions initiated prior to execution of the FENCE instruction forSEND data transfers between the two endpoints.

The arrangement of compute nodes, networks, and I/O devices making upthe example parallel computer illustrated in FIG. 1 are for explanationonly, not for limitation of the present invention. Parallel computerscapable of fencing data transfers in a PAMI according to embodiments ofthe present invention may include additional nodes, networks, devices,and architectures, not shown in FIG. 1, as will occur to those of skillin the art. The parallel computer (100) in the example of FIG. 1includes sixteen compute nodes (102); parallel computers capable offencing data transfers in a PAMI according to embodiments of the presentinvention sometimes include thousands of compute nodes. In addition toEthernet and JTAG, networks in such data processing systems may supportmany data communications protocols including for example TCP(Transmission Control Protocol), IP (Internet Protocol), and others aswill occur to those of skill in the art. Various embodiments of thepresent invention may be implemented on a variety of hardware platformsin addition to those illustrated in FIG. 1.

Fencing data transfers in a PAMI according to embodiments of the presentinvention is generally implemented on a parallel computer that includesa plurality of compute nodes. In fact, such computers may includethousands of such compute nodes. Each compute node is in turn itself acomputer composed of one or more computer processors, its own computermemory, and its own input/output (‘I/O’) adapters. For furtherexplanation, therefore, FIG. 2 sets forth a block diagram of an examplecompute node (152) useful in a parallel computer that fences datatransfers in a PAMI according to embodiments of the present invention.The compute node (152) of FIG. 2 includes one or more computerprocessors (164) as well as random access memory (‘RAM’) (156). Eachprocessor (164) can support multiple hardware compute cores (165), andeach such core can in turn support multiple threads of execution,hardware threads as well as software threads. Each processor (164) isconnected to RAM (156) through a high-speed front side bus (161), busadapter (194), and a high-speed memory bus (154)—and through bus adapter(194) and an extension bus (168) to other components of the computenode. Stored in RAM (156) is an application program (158), a module ofcomputer program instructions that carries out parallel, user-level dataprocessing using parallel algorithms.

Also stored RAM (156) is an application messaging module (216), alibrary of computer program instructions that carry outapplication-level parallel communications among compute nodes, includingpoint to point operations as well as collective operations. Although theapplication program can call PAMI routines directly, the applicationprogram (158) often executes point-to-point data communicationsoperations by calling software routines in the application messagingmodule (216), which in turn is improved according to embodiments of thepresent invention to use PAMI functions to implement suchcommunications. An application messaging module can be developed fromscratch to use a PAMI according to embodiments of the present invention,using a traditional programming language such as the C programminglanguage or C++, for example, and using traditional programming methodsto write parallel communications routines that send and receive dataamong nodes through data communications networks or shared-memorytransfers. In this approach, the application messaging module (216)exposes a traditional interface, such as MPI, to the application program(158) so that the application program can gain the benefits of a PAMIwith no need to recode the application. As an alternative to coding fromscratch, therefore, existing prior art application messaging modules maybe improved to use the PAMI, existing modules that already implement atraditional interface. Examples of prior-art application messagingmodules that can be improved to FENCE with a PAMI according toembodiments of the present invention include such parallelcommunications libraries as the traditional ‘Message Passing Interface’(‘MPI’) library, the ‘Parallel Virtual Machine’ (‘PVM’) library, MPICH,and the like.

Also represented in RAM in the example of FIG. 2 is a PAMI (218).Readers will recognize, however, that the representation of the PAMI inRAM is a convention for ease of explanation rather than a limitation ofthe present invention, because the PAMI and its components, endpoints,clients, contexts, and so on, have particular associations with hardwaredata communications resources. In fact, the PAMI can be implementedpartly as software or firmware and hardware—or even entirely inhardware, in some embodiments at least.

Also represented in RAM (156) in the example of FIG. 2 is a segment(227) of shared memory. In typical operation, the operating system (162)in this example compute node assigns portions of address space to eachprocessor (164), and, to the extent that a processor support multiplecompute cores (165), treats each compute core as a separate processorwith its own assignment of a portion of core memory or RAM (156) for aseparate heap, stack, memory variable value storage, and so on. Thedefault architecture for such apportionment of memory space is that eachprocessor or compute core operates its assigned portion of memoryseparately, with no ability to access memory assigned to anotherprocessor or compute core. Upon request, however, the operating systemcan grant to one processor or compute core the ability to access asegment of memory that is assigned to another processor or compute core,and such a segment is referred to in this specification as a ‘segment ofshared memory.’

In the example of FIG. 2, each processor or compute core has uniformaccess to the RAM (156) on the compute node, so that accessing a segmentof shared memory is equally fast regardless where the shared segment islocated in physical memory. In some embodiments, however, modules ofphysical memory are dedicated to particular processors, so that aprocessor may access local memory quickly and remote memory more slowly.In such embodiments, a segment of shared memory can be configuredlocally for one endpoint and remotely for another endpoint. From theperspective of an origin endpoint transmitting data through a segment ofshared memory that is configured remotely with respect to the originendpoint and locally with respect to the target endpoint, transmittingdata through the segment of shared memory will appear slower that if thesegment of shared memory were configured locally with respect to theorigin endpoint—or if the segment were local to both the origin endpointand the target endpoint. This is the effect of the architecturerepresented by the compute node (152) in the example of FIG. 2—that allaccesses to segments of memory shared among processes or processors onthe compute node are local—and therefore very fast.

Also stored in RAM (156) in the example compute node of FIG. 2 is anoperating system (162), a module of computer program instructions androutines for an application program's access to other resources of thecompute node. It is possible, in some embodiments at least, for anapplication program, an application messaging module, and a PAMI in acompute node of a parallel computer to run threads of execution with nouser login and no security issues because each such thread is entitledto complete access to all resources of the node. The quantity andcomplexity of tasks to be performed by an operating system on a computenode in a parallel computer therefore can be somewhat smaller and lesscomplex than those of an operating system on a serial computer with manythreads running simultaneously with various level of authorization foraccess to resources. In addition, there is no video I/O on the computenode (152) of FIG. 2, another factor that decreases the demands on theoperating system. The operating system may therefore be quitelightweight by comparison with operating systems of general purposecomputers, a pared down or ‘lightweight’ version as it were, or anoperating system developed specifically for operations on a particularparallel computer. Operating systems that may usefully be improved orsimplified for use in a compute node according to embodiments of thepresent invention include UNIX™, Linux™, Microsoft XP™, AIX™, IBM'si5/OS™, and others as will occur to those of skill in the art.

The example compute node (152) of FIG. 2 includes several communicationsadapters (172, 176, 180, 188) for implementing data communications withother nodes of a parallel computer. Such data communications may becarried out serially through RS-232 connections, through external busessuch as USB, through data communications networks such as IP networks,and in other ways as will occur to those of skill in the art.Communications adapters implement the hardware level of datacommunications through which one computer sends data communications toanother computer, directly or through a network. Examples ofcommunications adapters useful in computers that fence data transfers ina parallel active messaging interface (‘PAMI’) according to embodimentsof the present invention include modems for wired communications,Ethernet (IEEE 802.3) adapters for wired network communications, and802.11b adapters for wireless network communications.

The data communications adapters in the example of FIG. 2 include aGigabit Ethernet adapter (172) that couples example compute node (152)for data communications to a Gigabit Ethernet (174). Gigabit Ethernet isa network transmission standard, defined in the IEEE 802.3 standard,that provides a data rate of 1 billion bits per second (one gigabit).Gigabit Ethernet is a variant of Ethernet that operates over multimodefiber optic cable, single mode fiber optic cable, or unshielded twistedpair.

The data communications adapters in the example of FIG. 2 includes aJTAG Slave circuit (176) that couples example compute node (152) fordata communications to a JTAG Master circuit (178). JTAG is the usualname used for the IEEE 1149.1 standard entitled Standard Test AccessPort and Boundary-Scan Architecture for test access ports used fortesting printed circuit boards using boundary scan. JTAG is so widelyadapted that, at this time, boundary scan is more or less synonymouswith JTAG. JTAG is used not only for printed circuit boards, but alsofor conducting boundary scans of integrated circuits, and is also usefulas a mechanism for debugging embedded systems, providing a convenient“back door” into the system. The example compute node of FIG. 2 may beall three of these: It typically includes one or more integratedcircuits installed on a printed circuit board and may be implemented asan embedded system having its own processor, its own memory, and its ownI/O capability. JTAG boundary scans through JTAG Slave (176) mayefficiently configure processor registers and memory in compute node(152) for use in fencing data transfers in a PAMI according toembodiments of the present invention.

The data communications adapters in the example of FIG. 2 includes aPoint To Point Adapter (180) that couples example compute node (152) fordata communications to a deterministic data communications network (108)that is optimal for point to point message passing operations such as,for example, a network configured as a three-dimensional torus or mesh.Point To Point Adapter (180) provides data communications in sixdirections on three communications axes, x, y, and z, through sixbidirectional links: +x (181), −x (182), +y (183), −y (184), +z (185),and −z (186). For ease of explanation, the Point To Point Adapter (180)of FIG. 2 as illustrated is configured for data communications in threedimensions, x, y, and z, but readers will recognize that Point To PointAdapters optimized for deterministic point-to-point operations infencing data transfers in a PAMI of a parallel computer according toembodiments of the present invention may in fact be implemented so as tosupport communications in two dimensions, four dimensions, fivedimensions, and so on.

The data communications adapters in the example of FIG. 2 includes aCollective Operations Adapter (188) that couples example compute node(152) for data communications to a network (106) that is optimal forcollective message passing operations such as, for example, a networkconfigured as a binary tree. Collective Operations Adapter (188)provides data communications through three bidirectional links: two tochildren nodes (190) and one to a parent node (192).

The example compute node (152) includes two arithmetic logic units(‘ALUs’). ALU (166) is a component of a processor (164), and a separateALU (170) is dedicated to the exclusive use of collective operationsadapter (188) for use in performing the arithmetic and logical functionsof reduction operations. Computer program instructions of a reductionroutine in an application messaging module (216) or a PAMI (218) maylatch an instruction for an arithmetic or logical function intoinstruction register (169). When the arithmetic or logical function of areduction operation is a ‘sum’ or a ‘logical OR,’ for example,collective operations adapter (188) may execute the arithmetic orlogical operation by use of ALU (166) in processor (164) or, typicallymuch faster, by use dedicated ALU (170).

The example compute node (152) of FIG. 2 includes a direct memory access(‘DMA’) controller (195), a module of logic circuitry configured toaccept DMA instructions and operate a DMA engine to carry them out, anda DMA engine (195), which is a module of automated computing machinerythat implements, through communications with other DMA engines on othercompute nodes, direct memory access to and from memory on its owncompute node and memory on other the compute nodes. Direct memory accessis a way of reading and writing to memory of compute nodes with reducedoperational burden on the central processing units (164); a CPUinitiates a DMA transfer, but the CPU does not execute the DMA transfer.A DMA transfer essentially copies a block of memory from one computenode to another, from an origin to a target for a PUT operation, from atarget to an origin for a GET operation. The DMA engine (195) of FIG. 2is configured to carry out DMA operations by transmitting to other DMAengines request to send (‘RTS’) messages, receiving from other DMAengines RTS messages, preparing to store data, sending acknowledgmentsthat the DMA engine is prepared to receive a data transmission fromother DMA engines; receiving such acknowledgements from another DMAengine, and transferring data to or from data storage on another computenode using DMA PUT and GET operations.

For further explanation, FIG. 3A illustrates an example of a Point ToPoint Adapter (180) useful in parallel computers that fence datatransfers in a PAMI according to embodiments of the present invention.Point To Point Adapter (180) is designed for use in a deterministic datacommunications network optimized for point to point operations, anetwork that organizes compute nodes in a three-dimensional torus ormesh. Point To Point Adapter (180) in the example of FIG. 3A providesdata communication along an x-axis through four unidirectional datacommunications links, to and from the next node in the −x direction(182) and to and from the next node in the +x direction (181). Point ToPoint Adapter (180) also provides data communication along a y-axisthrough four unidirectional data communications links, to and from thenext node in the −y direction (184) and to and from the next node in the+y direction (183). Point To Point Adapter (180) in also provides datacommunication along a z-axis through four unidirectional datacommunications links, to and from the next node in the −z direction(186) and to and from the next node in the +z direction (185). For easeof explanation, the Point To Point Adapter (180) of FIG. 3A asillustrated is configured for data communications in only threedimensions, x, y, and z, but readers will recognize that Point To PointAdapters optimized for deterministic point-to-point operations infencing data transfers in a PAMI of a parallel computer according toembodiments of the present invention may in fact be implemented so as tosupport communications in two dimensions, four dimensions, fivedimensions, and so on. Several supercomputers now use five dimensionalmesh or torus networks, including, for example, IBM's Blue Gene Q™.

For further explanation, FIG. 3B illustrates an example of a CollectiveOperations Adapter (188) useful in a parallel computer that fences datatransfers in a PAMI according to embodiments of the present invention.Collective Operations Adapter (188) is designed for use in a networkoptimized for collective operations, a network that organizes computenodes of a parallel computer in a binary tree. Collective OperationsAdapter (188) in the example of FIG. 3B provides data communication toand from two children nodes through four unidirectional datacommunications links (190). Collective Operations Adapter (188) alsoprovides data communication to and from a parent node through twounidirectional data communications links (192).

For further explanation, FIG. 4 sets forth a line drawing illustratingan example data communications network (108) optimized forpoint-to-point operations useful in parallel computers that fence datatransfers in a PAMI according to embodiments of the present invention.In the example of FIG. 4, dots represent compute nodes (102) of aparallel computer, and the dotted lines between the dots represent datacommunications links (103) between compute nodes. The datacommunications links are implemented with point-to-point datacommunications adapters similar to the one illustrated for example inFIG. 3A, with data communications links on three axis, x, y, and z, andto and fro in six directions +x (181), −x (182), +y (183), −y (184), +z(185), and −z (186). The links and compute nodes are organized by thisdata communications network optimized for point-to-point operations intoa three dimensional mesh (105). The mesh (105) has wrap-around links oneach axis that connect the outermost compute nodes in the mesh (105) onopposite sides of the mesh (105). These wrap-around links form a torus(107). Each compute node in the torus has a location in the torus thatis uniquely specified by a set of x, y, z coordinates. Readers will notethat the wrap-around links in the y and z directions have been omittedfor clarity, but are configured in a similar manner to the wrap-aroundlink illustrated in the x direction. For clarity of explanation, thedata communications network of FIG. 4 is illustrated with only 27compute nodes, but readers will recognize that a data communicationsnetwork optimized for point-to-point operations for use in fencing datatransfers in a PAMI of a parallel computer in accordance withembodiments of the present invention may contain only a few computenodes or may contain thousands of compute nodes. For ease ofexplanation, the data communications network of FIG. 4 is illustratedwith only three dimensions: x, y, and z, but readers will recognize thata data communications network optimized for point-to-point operationsfor use in fencing data transfers in a PAMI of a parallel computeraccording to embodiments of the present invention may in fact beimplemented in two dimensions, four dimensions, five dimensions, and soon. As mentioned, several supercomputers now use five dimensional meshor torus networks, including IBM's Blue Gene Q™.

For further explanation, FIG. 5 illustrates an example datacommunications network (106) optimized for collective operations byorganizing compute nodes in a tree. The example data communicationsnetwork of FIG. 5 includes data communications links connected to thecompute nodes so as to organize the compute nodes as a tree. In theexample of FIG. 5, dots represent compute nodes (102) of a parallelcomputer, and the dotted lines (103) between the dots represent datacommunications links between compute nodes. The data communicationslinks are implemented with collective operations data communicationsadapters similar to the one illustrated for example in FIG. 3B, witheach node typically providing data communications to and from twochildren nodes and data communications to and from a parent node, withsome exceptions. Nodes in a binary tree may be characterized as a rootnode (202), branch nodes (204), and leaf nodes (206). The root node(202) has two children but no parent. The leaf nodes (206) each has aparent, but leaf nodes have no children. The branch nodes (204) each hasboth a parent and two children. The links and compute nodes are therebyorganized by this data communications network optimized for collectiveoperations into a binary tree (106). For clarity of explanation, thedata communications network of FIG. 5 is illustrated with only 31compute nodes, but readers will recognize that a data communicationsnetwork optimized for collective operations for use in parallelcomputers that fence data transfers in a PAMI according to embodimentsof the present invention may contain only a few compute nodes orhundreds or thousands of compute nodes.

In the example of FIG. 5, each node in the tree is assigned a unitidentifier referred to as a ‘rank’ (250). The rank actually identifiesan instance of a parallel application that is executing on a computenode. That is, the rank is an application-level identifier. Using therank to identify a node assumes that only one such instance of anapplication is executing on each node. As mentioned, a compute node cansupport multiple processors, each of which can support multipleprocessing cores—so that more than one process or instance of anapplication can easily be present under execution on any given computenode—or in all the compute nodes, for that matter. To the extent thatmore than one instance of an application executes on a single computenode, the rank identifies the instance of the application as such ratherthan the compute node. A rank uniquely identifies an application'slocation in the tree network for use in both point-to-point andcollective operations in the tree network. The ranks in this example areassigned as integers beginning with ‘0’ assigned to the root instance orroot node (202), ‘1’ assigned to the first node in the second layer ofthe tree, ‘2’ assigned to the second node in the second layer of thetree, ‘3’ assigned to the first node in the third layer of the tree, ‘4’assigned to the second node in the third layer of the tree, and so on.For ease of illustration, only the ranks of the first three layers ofthe tree are shown here, but all compute nodes, or rather allapplication instances, in the tree network are assigned a unique rank.Such rank values can also be assigned as identifiers of applicationinstances as organized in a mesh or torus network.

For further explanation, FIG. 6 sets forth a block diagram of an exampleprotocol stack useful in parallel computers that fence data transfers ina PAMI according to embodiments of the present invention. The exampleprotocol stack of FIG. 6 includes a hardware layer (214), a systemmessaging layer (212), an application messaging layer (210), and anapplication layer (208). For ease of explanation, the protocol layers inthe example stack of FIG. 6 are shown connecting an origin compute node(222) and a target compute node (224), although it worthwhile to pointout that in embodiments that effect deterministic data transfers througha segment of shared memory, the origin compute node and the targetcompute node often are the same compute node—because the segment ofshared memory is local memory on a single compute node shared amongprocesses or processors on the same compute node. The granularity ofconnection through the system messaging layer (212), which isimplemented with a PAMI (218), is finer than merely compute node tocompute node—because, again, communications among endpoints through asegment of shared memory often is communications among endpoints on thesame compute node. Further explanation: The PAMI (218) connectsendpoints, connections specified by combinations of clients, contexts,and tasks, each such combination being specific to a thread of executionon a compute node, with each compute node capable of supporting manythreads and therefore many endpoints. Every endpoint typically canfunction as both an origin endpoint or a target endpoint for datatransfers through a PAMI, and both the origin endpoint and its targetendpoint can be located on the same compute node. So an origin computenode (222) and its target compute node (224) can in fact, and oftenwill, be the same compute node.

The application layer (208) provides communications among instances of aparallel application (158) running on the compute nodes (222, 224) byinvoking functions in an application messaging module (216) installed oneach compute node. Communications among instances of the applicationthrough messages passed between the instances of the application.Applications may communicate messages invoking function of anapplication programming interface (‘API’) exposed by the applicationmessaging module (216). In this approach, the application messagingmodule (216) exposes a traditional interface, such as an API of an MPIlibrary, to the application program (158) so that the applicationprogram can gain the benefits of a PAMI, reduced network traffic,callback functions, and so on, with no need to recode the application.Alternatively, if the parallel application is programmed to use PAMIfunctions, the application can call the PAMI functions directly, withoutgoing through the application messaging module.

The example protocol stack of FIG. 6 includes a system messaging layer(212) implemented here as a PAMI (218). The PAMI provides system-leveldata communications functions that support messaging in the applicationlayer (602) and the application messaging layer (610). Such system-levelfunctions are typically invoked through an API exposed to theapplication messaging modules (216) in the application messaging layer(210). Although developers can in fact access a PAMI API directly bycoding an application to do so, a PAMI's system-level functions in thesystem messaging layer (212) in many embodiments are isolated from theapplication layer (208) by the application messaging layer (210), makingthe application layer somewhat independent of system specific details.With an application messaging module presenting a standard MPI API to anapplication, for example, with the application messaging module retooledto use the PAMI to carry out the low-level messaging functions, theapplication gains the benefits of a PAMI with no need to incur theexpense of reprogramming the application to call the PAMI directly.Because, however, some applications will in fact be reprogrammed to callthe PAMI directly, all entities in the protocol stack above the PAMI areviewed by PAMI as applications. When PAMI functions are invoked byentities above the PAMI in the stack, the PAMI makes no distinctionwhether the caller is in the application layer or the applicationmessaging layer, no distinction whether the caller is an application assuch or an MPI library function invoked by an application. As far as thePAMI is concerned, any caller of a PAMI function is an application.

The protocol stack of FIG. 6 includes a hardware layer (634) thatdefines the physical implementation and the electrical implementation ofaspects of the hardware on the compute nodes such as the bus, networkcabling, connector types, physical data rates, data transmissionencoding and many other factors for communications between the computenodes (222) on the physical network medium. In many PAMI installations,the hardware layer will also include DMA resources as well as sharedmemory transfer capabilities.

For further explanation, FIG. 7 sets forth a functional block diagram ofan example PAMI (218) useful in parallel computers that fence datatransfers in a PAMI according to embodiments of the present invention.The PAMI (218) provides an active messaging layer that supports bothpoint to point communications in a mesh or torus as well as collectiveoperations, gathers, reductions, barriers, and the like in treenetworks, for example. The PAMI is a multithreaded parallelcommunications engine designed to provide low level message passingfunctions, many of which are one-sided, and abstract such functions forhigher level messaging middleware, referred to in this specification asapplications messaging modules in an application messaging layer. In theexample of FIG. 7, the application messaging layer is represented by ageneric MPI module (258), appropriate for ease of explanation becausesome form of MPI is a de facto standard for such messaging middleware.Compute nodes of a parallel computer (100, 102 on FIG. 1) are coupledfor data communications through such a PAMI and through datacommunications resources (294, 296, 314) that include at least onesegment (227 on FIG. 1) of shared random access memory through whichdata communications are delivered to target endpoints in the same orderin which the communications are transmitted from origin endpoints; thatis, the segment of shared memory is operated so as to effectdeterministic data communications among PAMI endpoints. The PAMIprovides data communications among data communications endpoints, whereeach endpoint is specified by data communications parameters for athread of execution on a compute node, including specifications of aclient, a context, and a task.

The PAMI (218) in this example includes PAMI clients (302, 304), tasks(286, 298), contexts (190, 292, 310, 312), and endpoints (288, 300). APAMI client is a collections is a collection of data communicationsresources (294, 295, 314) dedicated to the exclusive use of anapplication-level data processing entity, an application or anapplication messaging module such as an MPI library. Data communicationsresources to be assigned in collections to PAMI clients are explained inmore detail with reference to FIG. 8. FIG. 8 sets forth a functionalblock diagram of example data communications resources (220) useful inparallel computers that fence data transfers in a PAMI according toembodiments of the present invention. The data communications resourcesin the example of FIG. 8 include a DMA engine (226) with DMA controllogic (228), an injection FIFO (230), and a receive FIFO (232). The datacommunications resources of FIG. 8 also include a gigabit Ethernetadapter (238), an Infiniband adapter (240), a Fibre Channel adapter(242), a PCI Express adapter (246), a collective operations networkconfigured as a tree (106), a point to point network configured as atorus or mesh (108), and a segment (227) of shared memory. A PAMI isconfigured with clients, each of which is in turn configured withcertain collections of such data communications resources—so that, forexample, the PAMI client (302) in the PAMI (218) in the example of FIG.7 can have dedicated to its use a collection of data communicationsresources composed of six segments (227) of shared memory, six GigabitEthernet adapters (238), and six Infiniband adapters (240). And the PAMIclient (304) can have dedicated to its use six Fibre Channel adapters(242), a torus network (108), and five segments (227) of shared memory.And so on.

For further explanation of the deterministic operation of a segment ofshared memory, the segment (227) of shared memory in FIG. 8 isillustrated with an application programming interface or ‘API’ (488),control logic (225, 229), memory pointers (484, 486), and a Booleanstatus flag (490). The control logic (225, 229) can be implemented as ahardware memory controller accessed through the API (488) by advancefunctions of PAMI contexts—as a library subroutine that writes and readsdirectly to and from the segment of shared memory and is called throughthe API (488) by advance functions of PAMI contexts—as software logic inadvance functions of PAMI contexts that write and read directly to andfrom the segment of shared memory using no intervening API—and so on aswill occur to those of skill in the art. The segment (227) in thisexample is divided into bins (492), subdivisions of the segment (227) ofequal size, each large enough to hold a packet of payload data and aBoolean status flag (490). The status flag is set true to indicate‘dirty,’ that a packet of payload data has been written into a bin sincethe bin was read. The status flag is set false to indicate ‘free,’ thatpayload data in the bin has been read since the bin was last written sothat the bin is now free for reuse in writing payload data into thesegment (227) of shared memory.

The origin shared memory segment (‘SMS’) control logic (225) operates onbehalf of an origin endpoint by maintaining a memory pointer (484) thatpoints to a next bin into which the origin control (225) will writepayload data. The origin control (225) reads the status flag for thenext bin. If the bin is free, the origin control (225) writes payloaddata into the bin, sets the bin's status flag to ‘dirty,’ increments thememory pointer (484) to point to the next bin, and continues. If thebin's status flag indicates that the bin is not free, still dirty, theorigin control (225) pauses its data transfer operation until the bin isfreed by the target control (229). The target shared memory segment(‘SMS’) control logic (229) operates on behalf of a target endpoint bymaintaining a memory pointer (486) that points to a next bin from whichthe target control (229) will read payload data. The target control(229) reads the status flag for the next bin. If the bin is dirty, thetarget control (229) reads payload data from the bin, resets the bin'sstatus flag to ‘free,’ increments the memory pointer (486) to point tothe next bin, and continues. If the bin's status flag indicates that thebin is not dirty, still free, the target control (229) pauses its datatransfer operation until the bin is dirtied, written into, by the origincontrol (225). In this way, data are communicated through the segment(227) of shared memory to a target endpoint deterministically, that is,in the same order in which the data are transmitted from an originendpoint.

PAMI clients (203, 304 on FIG. 7) enable higher level middleware,application messaging modules, MPI libraries, and the like, to bedeveloped independently so that each can be used concurrently by anapplication. Although the application messaging layer in FIG. 7 isrepresented for example by a single generic MPI module (258), in fact, aPAMI, operating multiple clients, can support multiple message passinglibraries or application messaging modules simultaneously, a fact thatis explained in more detail with reference to FIG. 9. FIG. 9 sets fortha functional block diagram of an example PAMI (218) useful in parallelcomputers that fence data transfers in a PAMI according to embodimentsof the present invention in which the example PAMI operates, on behalfof an application (158), with multiple application messaging modules(502-510) simultaneously. The application (158) can have multiplemessages in transit simultaneously through each of the applicationmessaging modules (502-510). Each context (512-520) carries out, throughpost and advance functions, data communications for the application ondata communications resources in the exclusive possession, in eachclient, of that context. Each context carries out data communicationsoperations independently and in parallel with other contexts in the sameor other clients. In the example FIG. 9, each client (532-540) includesa collection of data communications resources (522-530) dedicated to theexclusive use of an application-level data processing entity, one of theapplication messaging modules (502-510):

-   -   IBM MPI Library (502) operates through context (512) data        communications resources (522) dedicated to the use of PAMI        client (532),    -   MPICH Library (504) operates through context (514) data        communications resources (524) dedicated to the use of PAMI        client (534),    -   Unified Parallel C (‘UPC’) Library (506) operates through        context (516) data communications resources (526) dedicated to        the use of PAMI client (536),    -   Partitioned Global Access Space (‘PGAS’) Runtime Library (508)        operates through context (518) data communications resources        (528) dedicated to the use of PAMI client (538), and    -   Aggregate Remote Memory Copy Interface (‘ARMCI’) Library (510)        operates through context (520) data communications resources        (530) dedicated to the use of PAMI client (540).

Again referring to the example of FIG. 7: The PAMI (218) includes tasks,listed in task lists (286, 298) and identified (250) to the application(158). A ‘task’ as the term is used in PAMI operations is a platformdefined integer datatype that identifies a canonical applicationprocess, an instance of a parallel application (158). Very carefully inthis specification, the term ‘task’ is always used to refer only to thisPAMI structure, not the traditional use of the computer term ‘task’ torefer to a process or thread of execution. In this specification, theterm ‘process’ refers to a canonical data processing process, acontainer for threads in a multithreading environment. In particular inthe example of FIG. 7, the application (158) is implemented as acanonical process with multiple threads (251-254) assigned variousduties by a leading thread (251) which itself executes an instance of aparallel program. Each instance of a parallel application is assigned atask; each task so assigned can be an integer value, for example, in a Cenvironment, or a separate task object in a C++ or Java environment. Thetasks are components of communications endpoints, but are not themselvescommunications endpoints; tasks are not addressed directly for datacommunications in PAMI. This gives a finer grained control than wasavailable in prior message passing art. Each client has its own list(286, 298) of tasks for which its contexts provide services; this allowseach process to potentially reside simultaneously in two or moredifferent communications domains as will be the case in certain advancedcomputers using, for example, one type of processor and network in onedomain and an completely different processor type and network in anotherdomain, all in the same computer.

The PAMI (218) includes contexts (290, 292, 310, 312). A ‘context’ asthe term is used in PAMI operations is composed of a subset of aclient's collection of data processing resources, context functions, anda work queue of data transfer instructions to be performed by use of thesubset through the context functions operated by an assigned thread ofexecution. That is, a context represents a partition of the local datacommunications resources assigned to a PAMI client. Every context withina client has equivalent functionality and semantics. Context functionsimplement contexts as threading points that applications use to optimizeconcurrent communications. Communications initiated by a local process,an instance of a parallel application, uses a context object to identifythe specific threading point that will be used to issue a particularcommunication independent of communications occurring in other contexts.In the example of FIG. 7, where the application (158) and theapplication messaging module (258) are both implemented as canonicalprocesses with multiple threads of execution, each has assigned ormapped particular threads (253, 254, 262, 264) to advance (268, 270,276, 278) work on the contexts (290, 292, 310, 312), including executionof local callbacks (272, 280). In particular, the local event callbackfunctions (272, 280) associated with any particular communication areinvoked by the thread advancing the context that was used to initiatethe communication operation in the first place. Like PAMI tasks,contexts are not used to directly address a communication destination ortarget, as they are a local resource.

Context functions, explained here with regard to references (472-482) onFIG. 9, include functions to create (472) and destroy (474) contexts,functions to lock (476) and unlock (478) access to a context, andfunctions to post (480) and advance (480) work in a context. For ease ofexplanation, the context functions (472-482) are illustrated in only oneexpanded context (512); readers will understand, however, that all PAMIcontexts have similar context functions. The create (472) and destroy(474) functions are, in an object-oriented sense, constructors anddestructors. In the example embodiments described in thisspecifications, post (480) and advance (482) functions on a context arecritical sections, not thread safe. Applications must somehow ensurethat critical sections are protected from re-entrant use. Applicationscan use mutual exclusion locks to protect critical sections. The lock(476) and unlock (478) functions in the example of FIG. 9 provide andoperate such a mutual exclusion lock to protect the critical sections inthe post (480) and advance (482) functions. If only a single threadposts or advances work on a context, then that thread need never lockthat context. To the extent that progress is driven independently on acontext by a single thread of execution, then no mutual exclusionlocking of the context itself is required—provided that no other threadever attempts to call a function on such a context. If more than onethread will post or advance work on a context, each such thread mustsecure a lock before calling a post or an advance function on thatcontext. This is one reason why it is probably a preferred architecture,given sufficient resources, to assign one thread to operate eachcontext. Progress can be driven with advance (482) functionsconcurrently among multiple contexts by using multiple threads, asdesired by an application—shown in the example of FIG. 7 by threads(253, 254, 262, 264) which advance work concurrently, independently andin parallel, on contexts (290, 292, 310, 312).

Posts and advances (480, 482 on FIG. 9) are functions called on acontext, either in a C-type function with a context ID as a parameter,or in object oriented practice where the calling entity possesses areference to a context or a context object as such and the posts andadvances are member methods of a context object. Again referring to FIG.7: Application-level entities, application programs and applicationmessaging modules, post (266, 274) data communications instructions tothe work queues (282, 284, 306, 308) in contexts and then call advancefunctions (268, 270, 276, 278) on the contexts to progress specific dataprocessing and data communications that carry out the instructions. Thedata processing and data communications comprising the advance functionsinclude specific messages, request to send (‘RTS’) and acknowledgments,callback execution, transfers of payload data, and so on. Advancefunctions therefore operate generally by checking a work queue for anynew instructions that need to be initiated and checking datacommunications resources for any incoming message traffic that needs tobe administered, with callbacks and the like. Advance functions alsocarry out or trigger transfers of payload data.

In at least some embodiments, the context's subset of a client's dataprocessing resources is dedicated to the exclusive use of the context.In the example of FIG. 7, context (290) has a subset (294) of a client's(302) data processing resources dedicated to the exclusive use of thecontext (290), and context (292) has a subset (296) of a client's (302)data processing resources dedicated to the exclusive use of the context(292). Advance functions (268, 270) called on contexts (290, 292)therefore never need to secure a lock on a data communications resourcebefore progressing work on a context—because each context (290, 292) hasexclusive use of dedicated data communications resources. Usage of datacommunications resources in this example PAMI (218), however, is notthread-safe. When data communications resources are shared amongcontexts, mutual exclusion locks are needed. In contrast to theexclusive usage of resources by contexts (290, 292), contexts (310, 312)share access to their client's data communications resource (314) andtherefore do not have data communications resources dedicated toexclusive use of a single context. Contexts (310, 312) therefore alwaysmust secure a mutual exclusion lock on a data communications resourcebefore using the resource to send or receive administrative messages orpayload data.

For further explanation, here is an example pseudocode Hello Worldprogram for an application using a PAMI:

int main(int argc, char ** argv) {     PAMI_client_t  client;    PAMI_context_t  context;     PAMI_result_t  status = PAMI_ERROR;    const char  *name = “PAMI”;     status  =PAMI_Client_initialize(name, &client);     size_t_n = 1;     status  =PAMI_Context_createv(client, NULL, 0,     &context, _n);    PAMI_configuration_t configuration;     configuration.name =PAMI_TASK_ID;     status = PAMI_Configuration_query(client,&configuration);     size_t task_id = configuration.value.intval;    configuration.name = PAMI_NUM_TASKS;     status =PAMI_Configuration_query(client, &configuration);     size_t num_tasks =configuration.value.intval;     fprintf (stderr, “Hello process %d of%d\n”, task_id,     num_tasks);     status =PAMI_Context_destroy(context);     status =PAMI_Client_finalize(client);     return 0; }

This short program is termed ‘pseudocode’ because it is an explanationin the form of computer code, not a working model, not an actual programfor execution. In this pseudocode example, an application initializes aclient and a context for an application named “PAMI.”PAMI_Client_initialize and PAMI_Context_createv are initializationfunctions (316) exposed to applications as part of a PAMI's API. Thesefunctions, in dependence upon the application name “PAMI,” pull from aPAMI configuration (318) the information needed to establish a clientand a context for the application. The application uses this segment:

PAMI_configuration_t configuration; configuration.name = PAMI_TASK_ID;status = PAMI_Configuration_query(client, &configuration); size_ttask_id = configuration.value.intval;to retrieve its task ID and this segment:

configuration.name = PAMI_NUM_TASKS; status =PAMI_Configuration_query(client, &configuration); size_t num_tasks =configuration.value.intval;to retrieve the number of tasks presently configured to carry outparallel communications and fencing of data transfers through the PAMI.The applications prints “Hello process task_id of num_tasks,” wheretask_id is the task ID of the subject instance of a parallelapplication, and num_tasks is the number of instances of the applicationexecuting in parallel on compute nodes. Finally, the applicationdestroys the context and terminates the client.

For further explanation, FIG. 10 sets forth a functional block diagramof example endpoints useful in parallel computers that fence datatransfers in a PAMI according to embodiments of the present invention.In the example of FIG. 10, a PAMI (218) is implemented with instances ontwo separate compute nodes (152, 153) that include four endpoints (338,340, 342, 344). Endpoints are opaque objects used to address an originor destination in a process and are constructed from a (client, task,context) tuple. Communication operations, such as SEND, PUT, and GET,address a destination with an endpoint object.

Each endpoint (338, 340, 342, 344) in the example of FIG. 10 is composedof a client (302, 303, 304, 305), a task (332, 333, 334, 335), and acontext (290, 292, 310, 312). A client is useful as a component in thespecification of an endpoint to disambiguate the task and contextidentifiers, as these identifiers may be the same for multiple clients.A task is useful as a component in the specification of an endpoint toconstruct an endpoint to address a process accessible through a context.A context is useful as a component in the specification of an endpointto identify the specific context associated with a the destination ortarget task—because the context identifies a specific threading point ona task. A context offset identifies which threading point is to processa particular communications operation. Endpoints enable “crosstalk”which is the act of issuing communication on a local context with aparticular context offset that is directed to a destination endpointwith no correspondence to a source context or source context offset.

For efficient utilization of storage in an environment where multipletasks of a client reside on the same physical compute node, anapplication may choose to write an endpoint table (288, 300 on FIG. 7)in a segment of shared memory (227, 346, 348). It is the responsibilityof the application to allocate such segments of shared memory andcoordinate the initialization and access of any data structures sharedbetween processes. This includes any endpoint objects which are createdby one process or instance of an application and read by anotherprocess.

Endpoints (342, 344) on compute node (153) serve respectively twoapplication instances (157, 159). The tasks (334, 336) in endpoints(342, 344) are different. The task (334) in endpoint (342) is identifiedby the task ID (249) of application (157), and the task (336) inendpoint (344) is identified by the task ID (251) of application (159).The clients (304, 305) in endpoints (342, 344) are different, separateclients. Client (304) in endpoint (342) associates data communicationsresources (e.g., 294, 296, 314 on FIG. 7) dedicated exclusively to theuse of application (157), while client (305) in endpoint (344)associates data communications resources dedicated exclusively to theuse of application (159). Contexts (310, 312) in endpoints (342, 344)are different, separate contexts. Context (310) in endpoint (342)operates on behalf of application (157) a subset of the datacommunications resources of client (304), and context (312) in endpoint(344) operates on behalf of application (159) a subset of the datacommunications resources of client (305).

Contrasted with the PAMIs (218) on compute node (153), the PAMI (218) oncompute node (152) serves only one instance of a parallel application(158) with two endpoints (338, 340). The tasks (332, 333) in endpoints(338, 340) are the same, because they both represent a same instance ofa same application (158); both tasks (332,333) therefore are identified,either with a same variable value, references to a same object, or thelike, by the task ID (250) of application (158). The clients (302, 303)in endpoints (338, 340) are optionally either different, separateclients or the same client. If they are different, each associates aseparate collection of data communications resources. If they are thesame, then each client (302, 303) in the PAMI (218) on compute node(152) associates a same set of data communications resources and isidentified with a same value, object reference, or the like. Contexts(290, 292) in endpoints (338, 340) are different, separate contexts.Context (290) in endpoint (338) operates on behalf of application (158)a subset of the data communications resources of client (302) regardlesswhether clients (302, 303) are the same client or different clients, andcontext (292) in endpoint (340) operates on behalf of application (158)a subset of the data communications resources of client (303) regardlesswhether clients (302, 303) are the same client or different clients.Thus the tasks (332, 333) are the same; the clients (302, 303) can bethe same; and the endpoints (338, 340) are distinguished at least bydifferent contexts (290, 292), each of which operates on behalf of oneof the threads (251-254) of application (158), identified typically by acontext offset or a threading point.

Endpoints (338, 340) being as they are on the same compute node (152)can effect data communications between endpoints (338, 340) through asegment of shared local memory (227). Communications between endpoint(340) and endpoint (344) on another compute node (153) go through thedeterministic network (108). Communications between endpoint (338) andendpoint (342) on another compute node (153) go through a segment ofshared remote memory (346). The segment of shared remote memory (346) isa component of a Non-Uniform Memory Access (‘NUMA’) architecture, asegment in a memory module installed anywhere in the architecture of aparallel computer except on a local compute node. The segment of sharedremote memory (346) is ‘remote’ in the sense that it is not installed ona local compute node. A local compute node is ‘local’ to the endpointslocated on that particular compute node. The segment of shared remotememory (346), therefore, is ‘remote’ with respect to endpoints (338,340) on compute node (158) if it is in a memory module on compute node(153) or anywhere else in the same parallel computer except on computenode (158).

Endpoints (342, 344) being as they are on the same compute node (153)can effect data communications between endpoints (342, 344) through asegment of shared local memory (348). Communications between endpoint(344) and endpoint (340) on another compute node (158) go through thedeterministic network (108). Communications between endpoint (342) andendpoint (338) on another compute node (158) go through a segment ofshared remote memory (346). Again, the segment of shared remote memory(346), therefore, is ‘remote’ with respect to endpoints (342, 344) oncompute node (153) if it is in a memory module on compute node (158) oranywhere else in the same parallel computer except on compute node(153).

For further explanation, FIG. 11 sets forth a flow chart illustrating anexample method of fencing data transfers in a PAMI of a parallelcomputer according to embodiments of the present invention. The methodof FIG. 11 is implemented in a PAMI (218) of a parallel computercomposed of a number of that execute a parallel application, like thosedescribed above in this specification with reference to FIGS. 1-10. ThePAMI includes data communications endpoints, with each endpointspecifying data communications parameters for a thread of execution on acompute node, including specifications of a client, a context, and atask, all as described above in this specification with reference toFIGS. 1-10. The compute nodes (152, 153, and 102 on FIG. 1) are coupledfor data communications through the PAMI (218) and through datacommunications resources including at least one segment (227) of sharedrandom access memory through which data communications are delivered totarget endpoints in the same order in which the communications aretransmitted from origin endpoints.

The method of FIG. 11 includes initiating (360) execution through thePAMI (218) of an ordered sequence of active SEND instructions (361) forSEND data transfers between two endpoints, an origin endpoint (352) anda target endpoint (354). Each SEND instruction (361) effects adeterministic SEND data transfer through a segment (227) of sharedmemory in which the SEND data transfers are effected according to theordered sequence of the SEND instructions (361). In this example, theorigin endpoint (352) and the target endpoint are located on the samecompute node (152), which is case when the segment (227) of sharedmemory is a segment of local shared memory accessible to both endpoints(352, 354) on the same compute node. When the segment (227) of sharedmemory is a segment of remote memory accessible across compute nodes,then the endpoints (352, 354) can be located on separate compute nodes.An application or application messaging module initiates execution ofthe ordered sequence of active SEND instructions by posting (266 or 274on FIG. 7) the SEND instructions to a work queue (282, 284, 306, or 308on FIG. 7) of a context (290, 292, 310, or 312 on FIG. 7). This sequenceof SEND instructions (361) effects data transfers between two particularendpoints (352, 354), with the entire sequence of SEND instructions(361) posted to a same work queue in a same context, a PAMI context ofthe source endpoint (352).

The method of FIG. 11 also includes executing (362) through the PAMI(218), with no FENCE accounting for SEND data transfers, an active FENCEinstruction (358). The FENCE instruction is an ‘active’ instruction inthat it is implemented with the aid of callback functions. The FENCEinstruction (358) is directed particularly to SEND instructions betweenthe two endpoints (352, 354), and the FENCE instruction (358) completesexecution only after completion of all SEND instructions initiated priorto execution of the FENCE instruction for SEND data transfers betweenthe two endpoints. That is, the FENCE instruction executesdeterministically with respect to all previously initiated SENDinstructions (361). There are a number of ways in which suchdeterministic execution can be implemented. An application can post theFENCE instruction to a work queue of a context whose advance functionsexecute instructions in the work queue strictly in the order in whichinstructions are posted into the queue—so that execution of the FENCEinstruction will not complete until after all previously posted SENDinstructions have completed. To the extent that the FENCE instructionrequires administrative communications with a target endpoint, requestto send, advise messages, callbacks, and the like, advance functions ofcontexts of the endpoints (352, 354) deterministically operatecommunications between the endpoints through the segment (227) of sharedmemory, allowing the FENCE-related communications to complete only aftercompletion of all supporting communications and data transfers of allpreviously initiated SEND instructions.

For further explanation, FIG. 12 sets forth a flow chart illustrating anexample of a shared memory rendezvous method of fencing data transfersin a PAMI of a parallel computer according to embodiments of the presentinvention. A rendezvous method of fencing is a method of fencing for usein a rendezvous messaging protocol. Rendezvous protocols aredistinguished from eager protocols: An eager protocol expects to sendheader information, message ID, addresses, endpoints, buffer addresses,message size, and so on, along with payload data, all in the samemessage. Eager protocols therefore reduce data communications trafficfor small messages. An eager protocol, however, requires messagebuffering sufficient for header and payload of an entire message, sothat buffer space requirements can be large in an environment with manyeager messages. In contrast, a rendezvous protocol is directed towardlarger messages with target buffers in application space, so thatrendezvous protocols result in more data communications traffic withreduced demand for buffering in a system messaging layer such as a PAMI.PAMIs for fencing according to embodiments of the present applicationtypically support both rendezvous and eager protocols. FIG. 12illustrates an example of a rendezvous method of fencing. For furtherexplanation, FIG. 13 sets forth a calling sequence diagram furtherillustrating the operations of the method of FIG. 12, an example of ashared memory rendezvous method of fencing data transfers in a PAMI of aparallel computer according to embodiments of the present invention. Themethod of FIG. 12 is described below in this specification, therefore,with reference both to FIG. 12 and also to FIG. 13, using referencenumbers from both FIGS. 12 and 13.

The method of FIG. 12 is implemented in a PAMI (218) of a parallelcomputer composed of a number of compute nodes (102 on FIG. 1) thatexecute a parallel application (158, 159), like those described above inthis specification with reference to FIGS. 1-10. The PAMI (218) includesdata communications endpoints (352, 354), with each endpoint specifyingdata communications parameters for a thread of execution on a computenode, including specifications of a client, a context, and a task, allas described above in this specification with reference to FIGS. 1-10.The endpoints (352, 354) are coupled for data communications through thePAMI (218) and through data communications resources including at leastone segment (227) of shared random access memory through which datacommunications are delivered to target endpoints deterministically, thatis, in the same order in which the communications are transmitted fromorigin endpoints. The endpoints (352, 354) can be located on a samecompute node (152), although readers will recognize that a sourceendpoint and a target endpoint in a data processing environment thatincludes a Non-Uniform Memory Access (‘NUMA’) architecture can belocated on different compute nodes.

The method of FIG. 12 includes receiving (364) in an origin endpoint(352) of a PAMI (218) a SEND instruction (390). The SEND instruction(390) is received in the origin endpoint (352) through operation of apost function (480) called by an application (158) on a context (512) ofthe origin endpoint (352), posting the SEND instruction (390) to a workqueue (e.g., 282, 284 on FIG. 7) of the context (512). The SENDinstruction (390) specifies a data transfer to a target endpoint (354),and the SEND instruction also specifies a SEND done callback function(391) for the SEND instruction which is registered in the PAMI (218) forlater use. The SEND done callback function (391) is an application-levelinstruction called by an advance function of the PAMI when execution ofthe SEND instruction is fully complete. The SEND done callback (391) cancarry out any actions desired by the application at that point, butreaders will recognize that one purpose of the done callback is toadvise the calling application of completion of the data transferpursuant to the SEND instruction. The application's post of the SENDinstruction is non-blocking, so that the application continues otherwork while the PAMI executes the SEND instruction. Not blocking to waitfor the SEND instruction to complete, it is common for the applicationto want a callback to advise of completion of the data transfer effectedby the SEND.

The method of FIG. 12 also includes transmitting (368) from the originendpoint (352) to the target endpoint (354) a Request To Send (‘RTS’)message (394). The RTS message is transmitted by action of an advancefunction (482) called by an application (158) on a context (512) of theorigin endpoint (352). The RTS message in this example is transmittedthrough a segment (227) of shared memory. In the example of FIGS. 12 and13, if the origin endpoint (352) and the target endpoint (354) are bothlocated on the same compute node (152), then the segment (227) of sharedmemory is located in a module of random access memory that is uniformlyaccessible by both the origin endpoint and the target endpoint. The RTSmessage specifies a dispatch callback function (396) that includes ashared memory operation (404) that transfers data through a segment(227) of shared memory. The dispatch callback (396) is a callbackfunction to be called upon message dispatch, that is, upon receipt ofthe RTS message by the target endpoint. The RTS message is received inthe target endpoint by action of an advance function, called by anapplication (159) or an application messaging module on a context of thetarget endpoint (354), checking its data communications resources forincoming RTS messages and executing any dispatch callbacks that it findsthere.

The method of FIG. 12 also includes executing (370) executing by thetarget endpoint (354) the dispatch callback function (396) specified bythe RTS message (394), including registering a transfer done callbackfunction (397) in the PAMI and transferring (404, 406) data from thesource endpoint to the target endpoint through the segment (227) ofshared memory. In this example, the calling application (158) on theorigin side of the data transfer places the transfer data in the segmentof shared memory before posting the SEND instruction to the context ofthe origin endpoint (352). The RTS message (394) advises the targetendpoint (354) of the location of the transfer data in the segment (227)of shared memory. And the shared memory operation (404) that moves orcopies the transfer data from the shared memory segment into a receivebuffer of the target endpoint is typically implemented as a memoryoperation of the kind represented in C and C++ by the strcpy( )function, the memcpy( ) function, and the like. An advance functioncalled by an application (159) on a context of the target endpoint (354)executes the dispatch callback (396), including the shared memoryoperation (404). Executing the dispatch callback also includesregistering in PAMI a done callback function (397) for the shared memoryoperation (404).

The method of FIG. 12 also includes, upon completion of the datatransfer, executing (374, 408) by the target endpoint (354) the transferdone callback function (397), including advising (410) the application(159) of the arrival of the transfer data and sending to the origin nodethrough the shared memory segment a SEND done message (416) advising theorigin endpoint (352) of completion of the data transfer (406). Themethod of FIG. 12 also includes executing (376, 420) by the originendpoint (352) the SEND done callback function (391). An advancefunction called by the application (158) on a context of the originendpoint (352), checking its data communications resources for incomingmessages, notes the arrival of the SEND done message (416) and executesthe previously registered SEND done callback (391).

The method of FIG. 12 also includes receiving (378) in the originendpoint (352) a FENCE instruction (392) directed particularly to SENDoperations between the origin endpoint (352) and the target endpoint(354). The FENCE instruction (390) is received in the origin endpoint(352) through operation of a post function (480) called by anapplication (158) on a context (512) of the origin endpoint (352),posting the FENCE instruction (392) to a work queue of the context(512). The FENCE instruction specifies a FENCE done callback function(393) which is registered in the PAMI for later use. The FENCE donecallback function (393) is an application-level instruction called by anadvance function of a PAMI when execution of the FENCE instruction isfully complete. The FENCE done callback (393) can carry out any actionsdesired by the application at that point, but readers will recognizethat one purpose of the done callback is to advise the callingapplication of completion of the FENCE. The application's post of theFENCE instruction is non-blocking, so that the application continuesother work while the PAMI executes the FENCE instruction. Not blockingto wait for the FENCE instruction to complete, it is common for theapplication to want a callback to advise of completion of the FENCE andtherefore of all the data transfer effected by previous SENDinstructions.

It is typical of a calling application (158), after posting the FENCEinstruction (382), to cease further messaging operations between the twoendpoints (352, 354) that are the subject of the FENCE until completionof all SEND data transfers previously initiated between the twoendpoints, which is signified by completion of the FENCE, which itselfis signified by the execution of the FENCE done callback (393) advisingthe calling application that the FENCE has completed. It is not afunction of the FENCE instruction itself to block messaging operationsbetween the endpoints until completion of the FENCE; the applicationmust provide this function, and messaging, in this example at least, ispermitted to continue between other endpoints on behalf of the sameapplication. On the other hand, most applications behave this waybecause it is in the application's interest to know by the FENCE whenall transfers between those two particular endpoints has completed; thatis the purpose of the FENCE in the first place.

The method of FIG. 12 also includes transmitting (380) the FENCEinstruction (398) from the origin endpoint (352) to the target endpoint(354), with the FENCE instruction specifying a dispatch callbackfunction (402). The dispatch callback is a callback function to becalled upon dispatch, that is, upon transmission from the originendpoint and receipt of the FENCE instruction by the target endpoint.The FENCE instruction (398) is transmitted from the origin endpoint(352) by action of an advance function (482) called by an application(158) on a context (512) of the origin endpoint (352), the context inwhich the FENCE instruction was posted. The FENCE instruction (398) isreceived in the target endpoint (354) by action of an advance function(483), called by an application (159) on a context (512) of the targetendpoint (354), checking its data communications resources for incomingmessages and executing any dispatch callbacks that it finds there.

The method of FIG. 12 also includes executing (382, 402), aftercompletion of all SEND data transfers previously initiated between thetwo endpoints (352, 354), by the target endpoint (354) the dispatchcallback function (402) for the FENCE instruction (398), includingregistering in PAMI a FENCE acknowledgment callback function (399). Thedispatch callback function (402) is executed in the target endpoint byaction of an advance function (483), called by an application (159) on acontext (513) of the target endpoint (354), checking its datacommunications resources for incoming messages and executing any FENCEdispatch callbacks that it finds there. The execution of the FENCEinstruction is implemented in this example as a zero byte GETinstruction (412) directed to the shared memory segment (227) as ineffect a shared memory no-operation command or ‘NOOP’, a nonsenseinstruction, GET nothing, except that advance functions of the PAMI(218) are improved to interpret such a zero byte GET or shared memoryNOOP as a component of a FENCE execution that signifies the completionof the FENCE. Such a zero byte GET or shared memory NOOP is placed uponarrival of the FENCE instruction (398) into a work queue of a context ofthe target endpoint (354) where it is executed deterministically by anadvance function called on that context, executed only after thetransfer done callback (397) for the last SEND instruction (394) whichwas placed in the work queue of the context of the target endpoint (354)before the dispatch callback (402) for the FENCE (398). The example ofFIGS. 12 and 13, for ease of illustration, shows only one SENDinstruction (394) and only one data transfer (406), although readerswill recognize that PAMI fencing of data transfers according toembodiments of the present invention are often directed to many SENDsand many data transfers, all of which must complete before the FENCEcompletes. In deterministic execution, the FENCE's dispatch callback(402) and its shared memory NOOP (412) is not taken from a work queueand executed until after all previously initiated SENDs and their datatransfers are fully processed.

The method of FIG. 12 also includes executing (386, 414) by the targetendpoint (354) the FENCE acknowledgment call back function (399),including transmitting through the segment of shared memory (227) fromthe target endpoint (354) to the origin endpoint (352) a FENCEacknowledgment message (418). The method of FIG. 12 also includesexecuting (388, 422) by the origin endpoint (352) the FENCE donecallback function (393), which was registered in the PAMI (218) earlierwhen execution of the FENCE (392) first began. That is, an advancefunction (482) called by an application (158) or an applicationmessaging module on a context (512) of the origin endpoint (352),monitors incoming messages on its assigned data communicationsresources, recognizes the incoming FENCE acknowledgement (418) asrepresenting full completion of the FENCE (392) and calls theappropriate FENCE done callback (393) previously registered with thePAMI (218).

For further explanation, FIG. 14 sets forth a flow chart illustrating anexample of a shared memory eager method of fencing data transfers in aPAMI of a parallel computer according to embodiments of the presentinvention. An eager method of fencing is a method of fencing for use inan eager messaging protocol. Eager protocols are distinguished fromrendezvous protocols. An eager protocol expects to send headerinformation, message ID, addresses, endpoints, buffer addresses, messagesize, and so on, along with payload data, all in the same message. Eagerprotocols therefore reduce data communications traffic for smallmessages. An eager protocol, however, requires message bufferingsufficient for header and payload of an entire message, so that bufferspace requirements can be large in an environment with many eagermessages. In contrast, a rendezvous protocol is directed toward largermessages with target buffers in application space, so that rendezvousprotocols result in more data communications traffic with reduced demandfor buffering in a system messaging layer such as a PAMI. PAMIs forfencing according to embodiments of the present application typicallysupport both rendezvous and eager protocols. FIG. 14 illustrates anexample of a rendezvous method of fencing. For further explanation, FIG.15 sets forth a calling sequence diagram further illustrating theoperations of the method of FIG. 14, an example of a shared memory eagermethod of fencing data transfers in a PAMI of a parallel computeraccording to embodiments of the present invention. The method of FIG. 14is described below in this specification, therefore, with reference bothto FIG. 14 and also to FIG. 15, using reference numbers from both FIGS.14 and 15.

The method of FIG. 14 is implemented in a PAMI (218) of a parallelcomputer composed of a number of compute nodes (102 on FIG. 1) thatexecute a parallel application (158, 159), like those described above inthis specification with reference to FIGS. 1-10. The PAMI (218) includesdata communications endpoints (352, 354), with each endpoint specifyingdata communications parameters for a thread of execution on a computenode, including specifications of a client, a context, and a task, allas described above in this specification with reference to FIGS. 1-10.The endpoints (352, 354) are coupled for data communications through thePAMI (218) and through data communications resources including at leastone segment (227) of shared random access memory through which datacommunications are delivered to target endpoints deterministically, thatis, in the same order in which the communications are transmitted fromorigin endpoints. The endpoints (352, 354) in many embodiments arelocated on a same compute node, although readers will recognize that asource endpoint and a target endpoint in a data processing environmentthat includes a Non-Uniform Memory Access (‘NUMA’) architecture can belocated on different compute nodes.

The method of FIG. 14 includes receiving (424) in an origin endpoint(352) of a PAMI (218) a SEND instruction (446). The SEND instruction(446) is received in the origin endpoint (352) through operation of apost function (480) called by an application (158) or an applicationmessaging module on a context (512) of the origin endpoint (352),posting the SEND instruction (390) to a work queue (e.g., 282, 284 onFIG. 7) of the context (352). The SEND instruction (446) specifies adata transfer to a target endpoint (354), and the SEND instruction alsospecifies a SEND done callback function (447) which is registered in thePAMI (218) for later use.

The method of FIG. 14 also includes transmitting (426) through a segment(227) of shared memory from the origin endpoint (352) to the targetendpoint (354) an RTS message (450) advising of a SEND data transfer.That is, a dispatch callback (452) of the RTS advises the targetendpoint (354) of a pending SEND transfer, buffer addresses, messagesize, and so on. The RTS message is transmitted by action of an advancefunction called by an application (158) or an application messagingmodule on a context of the origin endpoint (352). The RTS message (450)in this example is transmitted through a segment (227) of shared memory.In the example of FIGS. 14 and 15, if the origin endpoint (352) and thetarget endpoint (354) are both located on the same compute node (152),then the segment (227) of shared memory is located in a module of randomaccess memory that is uniformly accessible by both the origin endpointand the target endpoint. The RTS message (450) specifies a dispatchcallback function (452) that includes a shared memory operation thattransfers data through a segment (227) of shared memory. The RTS messageis received in the target endpoint (354) by action of an advancefunction (483), called by an application (159) or an applicationmessaging module on a context (513) of the target endpoint (354),checking its data communications resources for incoming RTS messages andexecuting any dispatch callbacks that it finds there.

The method of FIG. 14 also includes transferring (428, 454) payload datathrough the segment of shared memory from the origin endpoint (352) thetarget endpoint (354). The transfer is carried out by the targetendpoint's execution of the dispatch callback function (452) specifiedby the RTS (450). The dispatch callback includes a shared memoryoperation that carries out the transfer. In this example, the callingapplication (158) on the origin side of the data transfer places thepayload data in the segment (218) of shared memory before posting theSEND instruction to a context (512) of the origin endpoint (352). TheRTS message (450) advises the target endpoint (354) of the location ofthe transfer data in the segment (227) of shared memory. And the sharedmemory operation in the dispatch callback (452) moves or copies thetransfer data from the shared memory segment into a receive buffer ofthe target endpoint. The shared memory operation is typicallyimplemented as a memory operation of the kind represented in C and C++by the strcpy( ) function, the memcpy( ) function, and the like. Anadvance function (483) called by an application (159) or an applicationmessaging module on a context (513) of the target endpoint (354)executes the dispatch callback (452), including its shared memoryoperation. The dispatch callback function (452) or the advance function(483) in the target endpoint (354) that called the dispatch callback(452) sets status flags (490 on FIG. 8) in the segment (227) of sharedmemory indicating completion of the data transfer (454). The advancefunction (482) that transmitted the RTS (450) from the origin endpointblocks, monitors the status flags that are pertinent to the transfer,and executes (430, 456), upon completion of the data transfer (454), theSEND done callback function (447) previously registered in the PAMI(218).

The method of FIG. 12 also includes receiving (432) in the originendpoint (352) a FENCE instruction (448) directed particularly to SENDoperations between the origin endpoint (352) and the target endpoint(354). The FENCE instruction (390) is received in the origin endpoint(352) through operation of a post function (480) called by anapplication (158) on a context (512) of the origin endpoint (352),posting the FENCE instruction (392) to a work queue of the context. TheFENCE instruction (448) specifies a FENCE done callback function (449)which is registered in the PAMI (218) for later use. The application'spost of the FENCE instruction is non-blocking, so that the application(158) continues other work while the PAMI executes the FENCEinstruction. It is typical of a calling application (158), after issuingthe FENCE instruction by posting it to a context, to cease furthermessaging operations between the two endpoints that are the subject ofthe FENCE until completion of all SEND data transfers previouslyinitiated between the two endpoints—signified by completion of theFENCE—signified by the execution (470) of a FENCE done callback (449)advising the calling application (159) that the FENCE has completed. Itis not a function of the FENCE to block messaging operations between theendpoints until completion of the FENCE; the application itself mustprovide this function, and messaging will probably continue betweenother endpoints on behalf of the same application. On the other hand,most applications behave this way because it is in the application'sinterest to know by the FENCE when all transfers between those twoparticular endpoints has completed; that is the purpose of the FENCEcall in the first place.

The method of FIG. 14 also includes transmitting (434, 458), aftercompletion of all SEND data transfers previously initiated between thetwo endpoints, the FENCE instruction (448) through the segment (227) ofshared memory from the origin endpoint to the target endpoint (354). TheFENCE instruction (448) was posted to the work queue of the context(512) of the origin endpoint (352) after the illustrated SENDinstruction (446), and, for that matter, after all previously postedSEND instructions (not shown). The FENCE instruction (458) istransmitted by action of an advance function (482) called on a context(512) of the origin endpoint (352), the context in which the FENCEinstruction was posted. The advance function (482, 483) in the PAMI(218) deterministically advance work in work queues of contexts in thePAMI, so that the instructions in the queues are implemented or executedin the order in which they were posted to the work queues. The advancefunction (482) in the origin endpoint (352), therefore, begins executionof the FENCE instruction (448) by sending (458) the FENCE instruction tothe target endpoint (354) only after completing the SEND instruction(446), including the data transfer (454) and executing (430, 456) theSEND done callback (447). The example of FIGS. 14 and 15, for ease ofillustration, shows only one SEND instruction (446) and only one datatransfer (454), although readers will recognize that PAMI fencing ofdata transfers according to embodiments of the present invention areoften directed to many SENDs and many data transfers, all of which mustcomplete before the FENCE completes. In deterministic execution, theFENCE instruction (448) is not taken from a work queue for executionuntil after all previously initiated SENDs and their data transfers arefully processed.

The FENCE instruction (446, 458) specifies a FENCE dispatch callbackfunction (460), and the method of FIG. 14 includes executing (436) bythe target endpoint (354) the FENCE dispatch callback function (460),including registering in the PAMI a FENCE acknowledgment callbackfunction (401). The FENCE dispatch callback function (460) is executedin the target endpoint by action of an advance function (483), called byan application (159) on a context (513) of the target endpoint (354),checking its data communications resources for incoming messages andexecuting any FENCE dispatch callbacks that it finds there. Theexecution of the FENCE dispatch callback function (460) is implementedin this example as a zero byte GET instruction (462) directed to theshared memory segment (227) as, for example, a shared memoryno-operation command or ‘NOOP’, a nonsense instruction, GET nothing,except that advance functions (482, 483) of the PAMI (218) are improvedto interpret such a zero byte GET or shared memory NOOP as a componentof a FENCE execution that signifies the completion of the FENCE.

The method of FIG. 14 also includes executing (440, 466) by the targetendpoint (354) the FENCE acknowledgment call back function (401),including transmitting through the segment (227) of shared memory fromthe target endpoint (354) to the origin endpoint (352) a FENCEacknowledgment message (468). The method of FIG. 14 also includesexecuting (442, 470) by the origin endpoint (352) the FENCE donecallback function (449), which was registered in the PAMI earlier whenexecution of the FENCE (448) first began. That is, an advance function(482) called on a context (512) of the origin endpoint (352), monitorsincoming messages on its assigned data communications resources,recognizes the incoming FENCE acknowledgement (468) as representing fullcompletion of the FENCE (448), and calls the appropriate FENCE donecallback (449) previously registered with the PAMI (218).

In view of the explanations set forth above, readers will recognize thatthe benefits of fencing data transfers in a PAMI of a parallel computeraccording to embodiments of the present invention include a new fenceprotocol that provides low-latency, eliminates data communicationscongestion due to the fence, and eliminates the need for counter arrays.Indeed, fencing data transfers according to embodiments of the presentinvention is carried out without maintaining any status informationwhatsoever on fenced data transfer messages, either SEND messages ortheir transfers of data.

Example embodiments of the present invention are described largely inthe context of a fully functional parallel computer that fences datatransfers in a parallel active messaging interface (‘PAMI’). Readers ofskill in the art will recognize, however, that the present inventionalso may be embodied in a computer program product disposed uponcomputer readable storage media for use with any suitable dataprocessing system. Such computer readable storage media may be anystorage medium for machine-readable information, including magneticmedia, optical media, or other suitable media. Examples of such mediainclude magnetic disks in hard drives or diskettes, compact disks foroptical drives, magnetic tape, and others as will occur to those ofskill in the art. Persons skilled in the art will immediately recognizethat any computer system having suitable programming means will becapable of executing the steps of the method of the invention asembodied in a computer program product. Persons skilled in the art willrecognize also that, although some of the example embodiments describedin this specification are oriented to software installed and executingon computer hardware, nevertheless, alternative embodiments implementedas firmware or as hardware are well within the scope of the presentinvention.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readable mediahaving computer readable program code embodied thereon.

Any combination of one or more computer readable media may be utilized.Such a computer readable medium may be a computer readable signal mediumor a computer readable storage medium. A computer readable storagemedium may be, for example, but not limited to, an electronic, magnetic,optical, electromagnetic, infrared, or semiconductor system, apparatus,or device, or any suitable combination of the foregoing. More specificexamples (a non-exhaustive list) of the computer readable storage mediumwould include the following: an electrical connection having one or morewires, a portable computer diskette, a hard disk, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or Flash memory), an optical fiber, a portable compactdisc read-only memory (CD-ROM), an optical storage device, a magneticstorage device, or any suitable combination of the foregoing. In thecontext of this document, a computer readable storage medium may be anytangible medium that can contain, or store a program for use by or inconnection with an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device. Program codeembodied on a computer readable medium may be transmitted using anyappropriate medium, including but not limited to wireless, wireline,optical fiber cable, RF, etc., or any suitable combination of theforegoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described in this specificationwith reference to flowchart illustrations and/or block diagrams ofmethods, apparatus (systems) and computer program products according toembodiments of the invention. It will be understood that each block ofthe flowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

It will be understood from the foregoing description that modificationsand changes may be made in various embodiments of the present inventionwithout departing from its true spirit. The descriptions in thisspecification are for purposes of illustration only and are not to beconstrued in a limiting sense. The scope of the present invention islimited only by the language of the following claims.

1. A method of fencing data transfers in a parallel active messaging interface (‘PAMI’) of a parallel computer, the parallel computer comprising a plurality of compute nodes that execute a parallel application; the PAMI comprising data communications endpoints, each endpoint comprising a specification of data communications parameters for a thread of execution on a compute node, including specifications of a client, a context, and a task; the compute nodes coupled for data communications through the PAMI and through data communications resources including at least one segment of shared random access memory through which data communications are delivered to target endpoints in the same order in which the communications are transmitted from origin endpoints; the method comprising: initiating execution through the PAMI of an ordered sequence of active SEND instructions for SEND data transfers between two endpoints, an origin endpoint and a target endpoint, each SEND instruction effecting a deterministic SEND data transfer through a segment of shared memory in which the SEND data transfers are effected according to the ordered sequence of the SEND instructions; and executing through the PAMI, with no FENCE accounting for SEND data transfers, an active FENCE instruction, the FENCE instruction completing execution only after completion of all SEND instructions initiated prior to execution of the FENCE instruction for SEND data transfers between the two endpoints.
 2. The method of claim 1 wherein: the client comprises a collection of data communications resources dedicated to the exclusive use of an application-level data processing entity; the context comprises a subset of the collection of data processing resources, context functions, and a work queue of data transfer instructions to be performed by use of the subset through the context functions operated by an assigned thread of execution; and the task represents a process of execution of the parallel application.
 3. The method of claim 1 wherein each context carries out, through post and advance functions, data communications for the parallel application on data communications resources in the exclusive possession of that context.
 4. The method of claim 1 wherein each context carries out data communications operations independently and in parallel with other contexts.
 5. The method of claim 1 wherein executing a FENCE instruction further comprises: receiving in the origin endpoint the FENCE instruction, the FENCE instruction specifying a FENCE done callback function; transmitting the FENCE instruction through the segment of shared memory from the origin endpoint to the target endpoint, the FENCE instruction specifying a dispatch callback function; executing, after completion of all SEND data transfers previously initiated between the two endpoint, by the target endpoint the dispatch callback function for the FENCE instruction, including registering in PAMI a FENCE acknowledgment callback function; executing by the target endpoint the FENCE acknowledgment callback function, including transmitting through the segment of shared memory from the target endpoint to the origin endpoint a FENCE acknowledgment message; and executing by the origin endpoint the FENCE done callback function.
 6. The method of claim 1 wherein executing a FENCE instruction further comprises: receiving in the origin endpoint the FENCE instruction, the FENCE instruction specifying a FENCE done callback function; transmitting, after completion of all SEND data transfers previously initiated between the two endpoints, the FENCE instruction through the segment of shared memory from the origin endpoint to the target endpoint, the FENCE instruction specifying a FENCE dispatch callback function; executing by the PAMI in the target compute node the dispatch callback function for the FENCE instruction, including sending to the origin a FENCE synchronization message; executing by the target endpoint the FENCE acknowledgment callback function, including transmitting through the segment of shared memory from the target endpoint to the origin endpoint a FENCE acknowledgment message; and executing by the origin endpoint the FENCE done callback function. 7-18. (canceled) 